﻿//********************************************************************************//
//创建日期：<创建日期，2016-09-27>
//创建作者：<孙雪婷，sunxueting@shanghai3h.com>
//功能说明：生成旧欠托收
//********************************************************************************//
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Entity;
using BLL;
using BLL.Access;
using System.Data;
using Platform.Http;
using Web.Class;

namespace Web.Pages.QuShui.DiXiaS.ShouFeiGL
{
    public partial class ShengChengJQTS : BasePage
    {
        #region 属性

        /// <summary>
        /// 记录操作人站点
        /// </summary>
        private string zhandianbh
        {
            get
            {
                return Convert.ToString(ViewState["zhandianbh"]);
            }
            set
            {
                ViewState["zhandianbh"] = value;
            }
        }

        /// <summary>
        /// 记录查询结果集
        /// </summary>
        private DataTable dtSource
        {
            get
            {
                return ViewState["dtSource"] as DataTable;
            }
            set
            {
                ViewState["dtSource"] = value;
            }
        }

        /// <summary>
        /// 记录列表二查询结果集
        /// </summary>
        private DataTable dtSource2
        {
            get
            {
                return ViewState["dtSource2"] as DataTable;
            }
            set
            {
                ViewState["dtSource2"] = value;
            }
        }

        #endregion

        #region 变量

        /// <summary>
        /// 数据访问操作类
        /// </summary>
        SpHelper _spHelper = new SpHelper();

        /// <summary>
        /// 托收明细BLL
        /// </summary>
        YS_SF_TUOSHOUMXBLL _YS_SF_TUOSHOUMXBLL = new YS_SF_TUOSHOUMXBLL();

        #endregion

        #region 事件

        /// <summary>
        /// 页面加载事件
        /// </summary>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                InitControl();
            }
            LoadData1();
        }

        /// <summary>
        /// 管理块选择项改变事件
        /// </summary>
        protected void cmbconGuanlik_SelectedIndexChanged(object sender, EventArgs e)
        {
            //LoadData1(true,null);
            //LoadData2(true);
        }

        /// <summary>
        /// 响应前台回调
        /// </summary>
        protected void ASPxCallback1_Callback(object source, DevExpress.Web.CallbackEventArgs e)
        {
           
        }

        
        /// <summary>
        /// 刷新列表2
        /// </summary>
        protected void gvList2_CustomCallback(object sender, DevExpress.Web.ASPxGridViewCustomCallbackEventArgs e)
        {
            LoadData2();
        }

        /// <summary>
        /// 刷新列表1
        /// </summary>
        protected void gvList1_CustomCallback(object sender, DevExpress.Web.ASPxGridViewCustomCallbackEventArgs e)
        {
            LoadData1();
        }

       

        #endregion

        #region 方法

        /// <summary>
        /// 初始化控件
        /// </summary>
        private void InitControl()
        {
        }

        /// <summary>
        /// 查询GRIDVIEW1数据
        /// </summary>
        /// <param name="reGet">是否重新读取数据库</param>
        private void LoadData1()
        {
            //加载托收进账单
            int tuoshoubh = 0;
            this.dtSource = SearchSpHelper.P_QSSF_JINZHANGD(2, tuoshoubh).Tables[0];
            this.gvList1.DataSource = this.dtSource;
            this.gvList1.DataBind();
        }

        /// <summary>
        /// 查询GRIDVIEW2数据
        /// </summary>
        /// <param name="reGet">是否重新读取数据库</param>
        private void LoadData2()
        {
            string bianhao = "";
            this.dtSource2 = _spHelper.P_QSSF_TUOSHOUMX(bianhao).Tables[0];
            this.gvList2.DataSource = this.dtSource2;
            this.gvList2.DataBind();
        }

        
        #endregion    
    }
}